package com.mingqijia.gassafety.webserver.webSocket;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
/**
 * @author zhangfei
 * @version 1.0.0
 * @ClassName RedisTopicSendTemplate.java
 * @createTime 2022年06月23日
 */
@Component
public class RedisTopicSendTemplate {

	@Autowired
	private RedisTemplate<String, Object> redisTemplate;

	/**
	 * 发送消息
	 * @param msg
	 */
	public void sendMsg(String topic, String msg) {
		redisTemplate.convertAndSend(topic, msg);
	}
}
